<template>
  <div class="expandBox">
    <div class="payCenter">
      <div class="pay-title">支付中心</div>
      <div class="pay-bg">
        <div class="pay-user"></div>
        <div class="pay-serect">
          <div class="select-bg">
            VIP
          </div>
        </div>
      </div>

      <div class="introduce">
        <div class="illustrate">VIP尊享不限量极速下载、视频倍速、超大空间、在线解压8G、批量转存数50000个等50+特权。</div>
        <div class="illustrate-item">
          <div :class="[selectIndex == index ? 'illustrate-select' : 'illustrate-selectTwo']" v-for="(item, index) in price"
            :key="index" @click="selectItem(index)">
            <div class="illustrate-name">{{ item.name }}</div>
            <div class="illustrate-price">￥<span>{{ item.money }}</span></div>
            <div class="original-price">￥{{ item.money + 50 }}</div>
            <div class="bottom-pricw">立省￥{{ item.illustrate }}</div>
          </div>
        </div>
        <div class="continuous">·到期以￥263自动续费12个月，可随时取消</div>

        <div class="Scan-code">
          <div class="San-title">扫码支付</div>
          <div></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue'

const price = ref([
  {
    name: '连续包年',
    money: 234,
    illustrate: 34,
  },
  {
    name: '连续包年',
    money: 234,
    illustrate: 34,
  },
  {
    name: '连续包年',
    money: 234,
    illustrate: 34,
  },

])

const selectIndex = ref(0)

const selectItem = (index) => {
  selectIndex.value = index
}
</script>

<style lang="scss" scoped>
.expandBox {
  width: 100vw;
  height: 100vh;
  box-sizing: border-box;

  // background-color:red
  .payCenter {
    width: 60vw;
    // height: 100%;
    margin: 0 auto;
    // border: 1px solid red;

    .pay-title {
      font-size: 20px;
      margin-top: 20px;
      // border: 1px solid red;
      text-align: left;
    }

    .pay-bg {
      margin-top: 10px;
      width: 100%;
      height: 15vh;
      background: url('../../assets/image/user_card_bg.png');
      background-size: 100% 100%;

      .pay-user {
        height: 9vh;
        // border: 1px solid red;
      }

      .pay-serect {
        // border: 1px solid red;
        height: 6vh;

        .select-bg {
          // border: 1px solid red;
          width: 10vw;
          height: 6vh;
          background: url('../../assets//image/double_middle_red.png');
          background-size: 100% 100%;
          color: #6B2D00;
          font-size: 22px;
          font-weight: bold;
          display: flex;
          align-items: center;
          justify-content: center;
        }
      }
    }
    .dark .introduce{
      background-color: red;
    }

    .introduce {
      width: 100%;
      // height: 18vh;
      // background-color: white;
      padding: 1px;
      // border: 1px solid red;

      .illustrate {
        font-size: 14px;
        color: #cc782b;
        // border: 1px solid red;
        text-align: left;
        margin-left: 10px;
        margin-top: 5px;
      }

      .illustrate-item {
        // border: 1px solid red;
        margin-top: 10px;
        height: 16vh;
        padding: 5px;
        display: flex;
        // justify-content: space-around;

        .illustrate-select {
          border: 2px solid #FF6F0B;
          background: linear-gradient(101.37deg, #fff9c6 1.05%, #ffe1c2 97.37%);
          width: 8vw;
          height: 100%;
          border-radius: 10px;
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          margin-right: 20px;
          // align-items: center;
          overflow: hidden;

          .illustrate-name {
            color: #cc782b;
            font-size: 18px;
            font-weight: bold;
            margin-top: 10px;
          }

          .illustrate-price {
            color: #f60;
            font-size: 24px;

            span {
              font-size: 34px;
              font-weight: bold;
            }
          }

          .original-price {
            color: gray;
            font-size: 14px;
            position: relative;
          }

          .original-price:after {
            content:"";
            position: absolute;
            width: 45px;
            height: 1px;
            background-color: gray;
            // border: 1px solid red;
            top: 40%;
            left: 38%;
          }

          .bottom-pricw {
            height: 3vh;
            background: linear-gradient(270deg, #f60, #ffa047);
            color: white;
            text-align: center;
            line-height: 3vh;
          }
        }


        .illustrate-selectTwo {
          // border: 2px solid red;
          border: 2px solid transparent;

          background-color: #f7f9fc;
          width: 8vw;
          height: 100%;
          border-radius: 10px;
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          margin-right: 20px;
          overflow: hidden;

          .illustrate-name {
            color: black;
            font-size: 16px;
            margin-top: 10px;
          }

          .illustrate-price {
            color: #f60;
            font-size: 24px;

            span {
              font-size: 34px;
              font-weight: bold;
            }
          }

          .original-price {
            color: gray;
            font-size: 14px;
            position: relative;
          }
          .original-price:after {
            content:"";
            position: absolute;
            width: 45px;
            height: 1px;
            background-color: gray;
            // border: 1px solid red;
            top: 40%;
            left: 38%;
          }

          .bottom-pricw {
            height: 3vh;
            // background: linear-gradient(270deg, #f60, #ffa047);
            background-color: #FFF6E8;
            color: rgba(107, 45, 0, .6);
            text-align: center;
            line-height: 3vh;
          }
        }
      }

      .continuous{
        margin-top: 5px;
        font-size: 14px;
        color: gray;
        text-align: left;
      }

      .Scan-code{
        display: flex;
        // San-title
      }
    }
  }
}
.dark .introduce{
  background-color: rgb(139, 47, 47);
}
</style>